{{!< default}} <div class="content-wrap">
    <div id="content" class="content">
        <section id="posts" class="posts-expand">
            {{#foreach posts}}
            <article class="post posts-type-normal">
                <header class="post-header">
                    <h1 class="post-title" itemprop="name headline">
                        <a class="post-title-link" href="{{url}}">{{{title}}}</a>
                    </h1>
                    <div class="post-meta">
                        <span class="post-time">
                            <span class="post-id">{{id}}</span>
                            <span class="post-meta-item-icon">
                                <i class="fa fa-user"></i>
                            </span>
                            <span>{{author}}</span>&nbsp; | &nbsp;
                            <span class="post-meta-item-icon">
                                <i class="fa fa-calendar-o"></i>
                            </span>
                            <span class="post-meta-item-text">发表于</span>
                            <time>{{date format='YYYY-MM-DD'}}</time>
                        </span>
                        <span class="post-category">&nbsp; | &nbsp;
                            <span class="post-meta-item-icon">
                                <i class="fa fa-folder-o"></i>
                            </span>
                            <span class="post-meta-item-text">标签</span>
                            <span itemprop="about">
                                {{#if tags}} {{tags}} {{/if}}
                            </span>
                        </span>
                        <span class="post-pv">&nbsp; | &nbsp;
                            <span class="post-meta-item-icon">
                                <i class="fa fa-eye"></i>
                            </span>
                            <span class="post-meta-item-text">阅读数</span>
                            <span class="{{id}}"></span>
                        </span>
                    </div>
                </header>
                <div class="post-body" itemprop="articleBody">
                    {{#if meta_description}} {{meta_description}} {{else}} {{excerpt characters="80"}} {{/if}}
                    <div class="post-more-link text-center">
                        <a class="btn" href="{{url}}" rel="contents">阅读全文 »</a>
                    </div>
                </div>
            </article>
            {{/foreach}}
        </section>
        {{pagination}}
    </div>
    </div>
    <div class="sidebar-toggle">
        <div class="sidebar-toggle-line-wrap">
            <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
            <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
            <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
        </div>
    </div>
    <aside id="sidebar" class="sidebar" style="display: none; width: 320px;">
        <div class="sidebar-inner">
            {{> sidebar}}
        </div>
    </aside>
    <script>
        $(".post-id").each(function () {
            var postId = $(this).text();
            // 查询文章pv
            $.ajax({
                url: CONFIG.APIURL + "/pv?postId=" + postId,
                method: "get",
                dataType: "json",
                success: function (res) {
                    if (res.code === 200) {
                        $("." + postId).text(res.data.pv)
                    } else if (res.code === 10000) {
                        $("." + postId).text(0)
                    }
                }
            })
        })
    </script>